package com.example.mystore.controller;

import com.example.mystore.model.ProductReview;
import com.example.mystore.model.User;
import com.example.mystore.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/messages")
public class MessageController {

    @Autowired
    private ReviewService reviewService;

    // 获取所有留言
    @GetMapping
    public List<ProductReview> getAllMessages() {
        return reviewService.getProductReviews(null);
    }
}